(function(){
  setRemUnit()
  window.addEventListener('resize',setRemUnit)
  function setRemUnit(){
    var doc=document.documentElement;
    var ratio=18.75;
    var viewWith=doc.getBoundingClientRect().width || window.innerWidth
    doc.style.fontSize=viewWith/ratio+'px'
  }
})()